package com.lyhcc.utils;


public class Fraction {
    private int molecular;      //分子
    private int denominator;    //分母

    public Fraction(){

    }

    public Fraction(int molecular, int denominator) {
        this.molecular = molecular;
        this.denominator = denominator;
    }


    public void swap(){
        int tmp = this.molecular;
        this.molecular = this.denominator;
        this.denominator = tmp;

    }

    public int getMolecular() {
        return molecular;
    }

    public void setMolecular(int molecular) {
        this.molecular = molecular;
    }

    public int getDenominator() {
        return denominator;
    }

    public void setDenominator(int denominator) {
        this.denominator = denominator;
    }

    @Override
    public String toString() {
        return this.molecular+"/"+this.denominator;
    }
}
